// vue.config.js
const path = require('path')
module.exports = {
    chainWebpack: config => {
        config.plugin('html').tap(args => {
            args[0].title = '酷学'
            return args
        })
    },
    pluginOptions: {
        'style-resources-loader': {
            preProcessor: 'less',
            patterns: [
                // 全局less变量存储路径
                path.resolve(__dirname, './src/App.less'),
            ]
        }
    },
    devServer: {
        open: true, // 是否启动打开浏览器
        host: '0.0.0.0', // 主机，0.0.0.0支持局域网地址，可以用真机测试
        port: 8082, // 端口
        https: false, // 是否启动https
        // 配置跨域代理http,https 
        proxy: {
            '/video-dev': {
                target: 'https://aikoolearn.com/video-dev',
                // target: 'https://230ck94613.picp.vip/video-dev', // 秉岩本地
                changeOrigin: true,
                pathRewrite: {
                    '^/video-dev': ''
                }
            },
            '/api': {
                target: 'http://apit.skyelearning.cn/api',
                // target: 'https://230ck94613.picp.vip/video-dev', // 秉岩本地
                changeOrigin: true,
                pathRewrite: {
                    '^/api': ''
                }
            }
        }
    }
}